package com.syxbyi._2threadpool;

import java.io.File;
import java.util.LinkedList;
import java.util.List;

public class DirectoryTreeNode {
    public DirectoryTreeNode parent;
    public List<DirectoryTreeNode> children;
    public File file;
    public boolean copied = false;      // 表示文件已拷贝完毕

    public DirectoryTreeNode(DirectoryTreeNode parent, File file) {
        this.parent = parent;
        this.file = file;
        children = new LinkedList<>();
    }

    public void addChild(DirectoryTreeNode child) {
        children.add(child);
    }

    public void removeChild(DirectoryTreeNode child) {
        children.remove(child);
    }

    @Override
    public String toString() {
        return "DirectoryTreeNode{" +
                "parent=" + parent +
                ", children=" + children +
                ", file=" + file +
                ", copied=" + copied +
                '}';
    }
}
